package clazz.abs.abs_factory.computer;

public abstract class  Computer implements USB,HDMI{
    private USBDisk usbDisk;

    public void insertUSBDevice(USB usb) {
        if (usb instanceof USBDisk) {
            this.usbDisk = (USBDisk) usb;
        }
    }
    @Override
    public String read(String path){
        if(null== usbDisk){
            return "没有插入U盘";
        }
        return usbDisk.read(path);
    }

    @Override
    public  void write(String data){
        if(null==usbDisk){
            return;
        }
        usbDisk.write(data);
    }


    public abstract void makeComputer();
}

